package cate.common.table.activity.customgrowth;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import easy.java.dev.note.NoteField;

public class CustomGrowthRow extends ERow {
    @NoteField("英雄ID")
    public int tid;
    @NoteField("ID")
    public int heroId;
    @NoteField("活动配置ID")
    public int configId;
    @NoteField("奖励")
    public String reward;
    @NoteField("购买类型")
    public int buyType;
    @NoteField("价格")
    public int price;
    @NoteField("充值项ID")
    public int payId;
    @NoteField("限购次数")
    public int limit;
    @NoteField("天数")
    public long cycle;
    @Override
    public void parse(XSSFRowWrap xrw) {
        this.id = xrw.getInteger("配置ID");
        this.heroId = xrw.getInteger("ID");
        this.tid = xrw.getInteger("英雄ID");
        this.configId = xrw.getInteger("活动配置ID");
        this.reward = xrw.getString("奖励");
        this.buyType = xrw.getInteger("购买类型");
        this.price = xrw.getInteger("价格", 0);
        this.payId = xrw.getInteger("充值项ID",0);
        this.limit = xrw.getInteger("限购次数", -1);
        this.cycle = xrw.getLong("天数", 0L);
    }

    @Override
    public void decode() {
        super.decode();
        this.cycle *= 24 * 60 * 60 * 1000L;
    }
}
